package cn.kgc.ebook.ebookmanagement.controller;

import cn.kgc.ebook.ebookmanagement.pojo.Category;
import cn.kgc.ebook.ebookmanagement.pojo.ResultEntity;
import cn.kgc.ebook.ebookmanagement.service.CategoryService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author shkstart
 * @create 2020-05-19 14:36
 */
@RestController
public class CategoryController {

    @Resource
    CategoryService categoryService;

    @RequestMapping("/getCategoryList")
    public ResultEntity<List<Category>> getCategoryList(){
        List<Category>categoryList=categoryService.selectAll();
        return ResultEntity.successWithoutData(categoryList);
    }

}
